//
//  TicketCell.m
//  didacar
//
//  Created by 度周末网络-王腾 on 15/12/17.
//  Copyright © 2015年 dzmmac. All rights reserved.
//

#import "TicketCell.h"

@implementation TicketCell

- (void)awakeFromNib {
    self.ticketBgView.layer.cornerRadius = 3;
    self.ticketBgView.layer.masksToBounds= YES;
    
    [CommoneTools changeConstraintView:self.rightLine constraintHeight:0.45];
    [CommoneTools changeConstraintView:self.leftLine constraintHeight:0.45];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

-(void)show:(NSIndexPath *)index{
    
    if (index.row == 0) {
        self.priceLabel.attributedText = [self getPrice:@"5"];
        self.valiableImg.image = [UIImage imageNamed:@"bg_ticket_abled"];
        self.valiableLabel.text = @"可使用";
        
    }else{
        self.priceLabel.attributedText = [self getPrice:@"155"];
        self.valiableImg.image = [UIImage imageNamed:@"bg_ticket_disabled"];
        self.valiableLabel.text = @"已过期";
        self.descLabel.text = @"此处最多显示2行，此处最多显示2行";
    }
}


-(NSAttributedString *)getPrice:(NSString *)price {
    NSMutableArray *mutableString = [[NSMutableArray alloc ] init];
    [mutableString addObject:[MainInfoTitleFields getInstaceWithText:price hexColor:@"#FFFFFF" fontSize:@"33"]];
    [mutableString addObject:[MainInfoTitleFields getInstaceWithText:@"元"  hexColor:@"#FFFFFF" fontSize:@"20"]];
    return [CommoneTools getAttributeString:mutableString];
}


@end
